var i = 0;
var interval;
var indexes = shuffle([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]);
function animate(){
	interval = setInterval(function(){
		if (i>15)
			clearInterval(interval);
		else
			td_animation(indexes[i++]);
	},300);
}
function td_animation(i){
	$('#td'+i).fadeOut(100);
	$('#td'+i).fadeIn(100);
	$('#td'+i).fadeOut(100);
	$('#td'+i).fadeIn('fast',function(){
		$('#td'+i).parent().removeClass("whitebg");
		$('#td'+i).fadeOut('slow');
	});
}
function shuffle(o){
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	return o;
}